import 'package:flutter_clx_base/flutter_clx_base.dart';
import 'package:flutter_clx_base_example/l10n/translations.dart';
import 'package:flutter_clx_base_example/sample.dart';
import 'package:flutter_clx_base_example/sample/dio/dio_utils.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  DioUtils.instance.initConfig();
  await SpUtil.getInstance();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      title: 'Flutter clx_base Demo',
      translations: AppTranslations(),
      supportedLocales: AppTranslations.supportedLocales,
      locale: Get.deviceLocale,
      fallbackLocale: AppTranslations.fallbackLocale,
      builder: EasyLoading.init(),
      localizationsDelegates: const [
        GlobalCupertinoLocalizations.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate
      ],
      theme: ThemeData(
        // This is the theme of your application.
        primarySwatch: Colors.blue,
      ),
      home: const Sample(),
    );
  }
}
